package model

import (
	"github.com/starmotioncf/common/filter"
	"github.com/starmotioncf/common/lang"
	"github.com/starmotioncf/common/region"
	"github.com/starmotioncf/soutchatinternal/constant"
	"gorm.io/gorm"
)

type ThirdGame struct {
	Id           int64                      `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
	Category     constant.ThirdGameCategory `json:"category" gorm:"column:category;type:tinyint(4);notNull;default:1;comment:游戏分类 1博彩游戏2休闲游戏"`
	Hot          constant.ThirdGameHot      `json:"hot" gorm:"column:hot;type:int(11);notNull;default:2;comment:是否热门，1是2否"`
	GameId       string                     `json:"game_id" gorm:"column:game_id;type:varchar(100);notNull;default:'';comment:第三方游戏id"`
	Name         lang.I18n                  `json:"name" gorm:"column:name;type:varchar(100);notNull;comment:游戏名称"`
	Icon         string                     `json:"icon" gorm:"column:icon;type:varchar(255);notNull;default:'';comment:小图标"`
	Image        string                     `json:"image" gorm:"column:image;type:varchar(255);notNull;default:'';comment:大图标"`
	Link         string                     `json:"link" gorm:"column:link;type:varchar(255);notNull;default:'';comment:游戏链接"`
	Filter       filter.Filter              `json:"filter" gorm:"column:filter;type:text;comment:过滤条件"`
	Height       float32                    `json:"height" gorm:"column:height;type:float(3,2);notNull;default:1.00;comment:屏幕高度，百分比"`
	Sort         int64                      `json:"sort" gorm:"column:sort;type:bigint(20);notNull;default:0;comment:排序，小到大"`
	Status       uint32                     `json:"status" gorm:"column:status;type:tinyint(3) unsigned;notNull;default:1;comment:状态1正常2下架"`
	Remark       string                     `json:"remark" gorm:"column:remark;type:varchar(255);notNull;default:'';comment:备注说明"`
	DepositRType int32                      `json:"deposit_r_type" gorm:"column:deposit_r_type;type:int(11);notNull;comment:赢取rtype，必须在vc_gold_type存在"`
	ConsumeRType int32                      `json:"consume_r_type" gorm:"column:consume_r_type;type:int(11);notNull;comment:下注操作rtype，必须在vc_gold_type存在"`
	PlatformCode string                     `json:"platform_code" gorm:"column:platform_code;type:varchar(20);notNull;default:'1';comment:游戏平台"`
	SecretKey    string                     `json:"secret_key" gorm:"column:secret_key;type:varchar(255);notNull;default:'';comment:加密或者签名密钥"`
	Region       region.Region              `json:"region" gorm:"column:region;type:int(11);notNull;default:0;comment:分区"`
	CreateBy     int64                      `json:"create_by" gorm:"column:create_by;type:bigint(20);notNull;default:0;comment:创建者"`
	UpdateBy     int64                      `json:"update_by" gorm:"column:update_by;type:bigint(20);notNull;default:0;comment:更新者"`
	CreatedAt    int64                      `json:"created_at" gorm:"column:created_at;type:bigint(20);notNull;default:0"`
	UpdatedAt    int64                      `json:"updated_at" gorm:"column:updated_at;type:bigint(20);notNull;default:0;comment:最后更新时间"`
	DeletedAt    gorm.DeletedAt             `json:"deleted_at" gorm:"column:deleted_at;type:bigint(20);notNull;default:0"`
}

func (ThirdGame) TableName() string {
	return "third_game"
}
